From 9b5b0661d3235eb228822c866167860a6236f4cf Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Tue, 28 Jan 2020 22:29:29 +0000 Subject: [PATCH] Xfail or loosen tolerances on flaky tests Author: Rebecca N. Palmer , Graham Inggs Bug-Debian: https://bugs.debian.org/944054 Forwarded: partially https://github.com/statsmodels/statsmodels/pull/6222 Gbp-Pq: Name 944054_flaky_tests.patch --- statsmodels/base/tests/test_penalized.py | 2 ++ statsmodels/stats/tests/test_diagnostic.py | 4 ++-- .../tsa/statespace/tests/test_exact_diffuse_filtering.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/statsmodels/base/tests/test_penalized.py b/statsmodels/base/tests/test_penalized.py index f519bc6..bca186d 100644 --- a/statsmodels/base/tests/test_penalized.py +++ b/statsmodels/base/tests/test_penalized.py @@ -312,6 +312,7 @@ class TestPenalizedPoissonOraclePenalized(CheckPenalizedPoisson): cls.atol = 1e-3 +@pytest.mark.xfail(reason="flaky convergence, https://bugs.debian.org/944054") class TestPenalizedPoissonOraclePenalized2(CheckPenalizedPoisson): @classmethod @@ -340,6 +341,7 @@ class TestPenalizedPoissonOraclePenalized2(CheckPenalizedPoisson): assert_equal(self.res1.bse[self.k_nonzero:], 0) +@pytest.mark.xfail(reason="flaky convergence, https://bugs.debian.org/944054") class TestPenalizedPoissonOraclePenalized2HC(CheckPenalizedPoisson): @classmethod diff --git a/statsmodels/stats/tests/test_diagnostic.py b/statsmodels/stats/tests/test_diagnostic.py index a8373cc..f01df52 100644 --- a/statsmodels/stats/tests/test_diagnostic.py +++ b/statsmodels/stats/tests/test_diagnostic.py @@ -470,7 +470,7 @@ class TestDiagnosticG(object): assert_almost_equal(jt1, jtest[0][3:5], decimal=13) jt2 = smsdia.compare_j(res, res2) - assert_almost_equal(jt2, jtest[1][3:5], decimal=14) + assert_almost_equal(jt2, jtest[1][3:5], decimal=13) #Estimate Std. Error z value Pr(>|z|) coxtest = [('fitted(M1) ~ M2', -0.782030488930356, 0.599696502782265, @@ -479,7 +479,7 @@ class TestDiagnosticG(object): -5.727181590258883, 1.021128495098556e-08, '***')] ct1 = smsdia.compare_cox(res, res2) - assert_almost_equal(ct1, coxtest[0][3:5], decimal=13) + assert_almost_equal(ct1, coxtest[0][3:5], decimal=12) ct2 = smsdia.compare_cox(res2, res) assert_almost_equal(ct2, coxtest[1][3:5], decimal=12) diff --git a/statsmodels/tsa/statespace/tests/test_exact_diffuse_filtering.py b/statsmodels/tsa/statespace/tests/test_exact_diffuse_filtering.py index 9cc786b..7203d1c 100644 --- a/statsmodels/tsa/statespace/tests/test_exact_diffuse_filtering.py +++ b/statsmodels/tsa/statespace/tests/test_exact_diffuse_filtering.py @@ -896,6 +896,7 @@ class TestDFM_Approx(CheckApproximateDiffuseMixin, CheckDFM): # we can't increase it too much more than this because then we start get # numerical errors (e.g. 1e11 works but 1e12 doesn't pass) approximate_diffuse_variance = 5e10 + rtol = 1e-6 class TestDFM_KFAS(CheckKFASMixin, CheckDFM): -- 2.30.2